package cn.tedu.shoppingmall.vo;

import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;
import java.util.List;

@Data
@Accessors(chain = true)
public class UserDetail {
    private Integer id;

    @NotBlank(message = "昵称不能为空")
    @Pattern(regexp = "^.{1,20}$",message = "昵称是1~20个字符")
    private String username;

    @NotBlank(message = "昵称不能为空")
    @Pattern(regexp = "^.{2,20}$",message = "昵称是2~20个字符")
    private String nick;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$",message = "请输入正确手机号")
    private String phone;

    @Pattern(regexp = "^(?:[1-9][0-9]?|1[01][0-9]|120)$",message = "请输入正确年龄0~120岁哦!")
    private String age;

    private Integer userid;
    //买过的商品总价
    private Double price;
    //买过的商品总数
    private Integer sum;
    //买过的头像地址
    private String url;
    //性别
    private String gender;
    //自我介绍
    private String intro;
    //创建时间
    private LocalDateTime createdOld;
    //更新时间
    private LocalDateTime createdNew;

    //给地址的集合
    private List<Address> addresses;


}
